home *** CD-ROM | disk | FTP | other *** search
/ Comix Games / Comix Games.iso / waldo / waldo.exe / WPRINT.DXR / 00011.ls < prev    next >
Encoding:
Text File  |  1995-10-08  |  3.3 KB  |  106 lines

  1. global gUserName, gFirstCharSprite, gNumberOfChars
  2.  
  3. on startMovie
  4.   go("Printing...")
  5.   if the machineType = 256 then
  6.     startTimer()
  7.     repeat while the timer < 180
  8.       nothing()
  9.     end repeat
  10.   end if
  11.   set the text of cast "userName" to gUserName
  12.   go("Printout")
  13.   setProp(1, 48, "puppet", 1)
  14.   nameToBitmap()
  15.   printFrom(the frame, the frame)
  16.   setProp(1, 48, "puppet", 0)
  17.   go("Printout2")
  18.   printFrom(the frame, the frame)
  19.   set the text of cast "userName" to "?"
  20.   play done
  21. end
  22.  
  23. on resetStage
  24.   set the rect of the stage to rect(64, 23, 576, 671)
  25. end
  26.  
  27. on nameToBitmap
  28.   if the controlDown then
  29.     go(the frame + 1)
  30.     go(the frame - 1)
  31.   end if
  32.   set gFirstCharSprite to 4
  33.   set gNumberOfChars to 40
  34.   if the number of chars in gUserName < gNumberOfChars then
  35.     set gNumberOfChars to the number of chars in gUserName
  36.   end if
  37.   set whichSprite to gFirstCharSprite - 1
  38.   set spaceCast to the number of cast " 32"
  39.   repeat with x = 1 to gNumberOfChars
  40.     set whichChar to char x of gUserName
  41.     set whichCast to the number of cast (whichChar & charToNum(whichChar))
  42.     if whichCast > 0 then
  43.       set whichSprite to whichSprite + 1
  44.       set the stretch of sprite whichSprite to 0
  45.       set the castNum of sprite whichSprite to whichCast
  46.       set the ink of sprite whichSprite to 36
  47.       set the backColor of sprite whichSprite to 0
  48.       if whichCast = spaceCast then
  49.         set the foreColor of sprite whichSprite to 0
  50.       else
  51.         set the foreColor of sprite whichSprite to 255
  52.       end if
  53.       updateStage()
  54.       set newWidth to 20.0 / gNumberOfChars
  55.       if newWidth < 0.10000000000000001 then
  56.         set newWidth to 0.10000000000000001
  57.       else
  58.         if newWidth > 2.0 then
  59.           set newWidth to 2.0
  60.         end if
  61.       end if
  62.       set newLeft to the left of sprite whichSprite
  63.       set newRight to (the right of sprite whichSprite - newLeft) * newWidth
  64.       if newRight < (newLeft + 2) then
  65.         put whichChar
  66.         set newRight to newRight + 2
  67.       end if
  68.       set newTop to the top of sprite whichSprite
  69.       set newBottom to the bottom of sprite whichSprite
  70.       spriteBox(whichSprite, newLeft, newTop, newRight, newBottom)
  71.       updateStage()
  72.       if whichSprite > gFirstCharSprite then
  73.         set charOffset to the left of sprite whichSprite - the locH of sprite whichSprite
  74.         set the locH of sprite whichSprite to the right of sprite (whichSprite - 1) + 1 - charOffset
  75.       end if
  76.       updateStage()
  77.     end if
  78.   end repeat
  79.   updateStage()
  80.   set nameLeft to the left of sprite gFirstCharSprite
  81.   set nameRight to the right of sprite whichSprite
  82.   set nameCenter to (nameRight - nameLeft) / 2
  83.   set centerStage to (the stageRight - the stageLeft) / 2
  84.   set offsetH to centerStage - nameCenter
  85.   repeat with x = gFirstCharSprite to whichSprite
  86.     set the locH of sprite x to the locH of sprite x + offsetH
  87.     set the locV of sprite x to 550
  88.   end repeat
  89.   repeat with x = whichSprite + 1 to gFirstCharSprite + 40
  90.     set the locV of sprite x to -500
  91.   end repeat
  92.   updateStage()
  93. end
  94.  
  95. on setProp startSprite, endSprite, whichProperty, whichValue
  96.   repeat with x = startSprite to endSprite
  97.     do("set the " & whichProperty & " of sprite x=whichValue")
  98.   end repeat
  99. end
  100.  
  101. on showChars
  102.   repeat with x = 30 to 255
  103.     put "Char " & x & ": " & numToChar(x)
  104.   end repeat
  105. end
  106.